mon_start = float(input("请输入你需要存放的金额："))
mon_end = float(input("请输入你的目标金额："))
i = 1
sum = 0
while True:
    sum = round(mon_start*1.05**i, 2)
    a = round(mon_start*1.05**i-mon_start*1.05**(i-1), 2)
    i+=1
    print(f"第{i-1}年的本息为：{sum}元，利息为{a}元")
    if sum > mon_end:
        print(f"需要{i-1}年达到目标金额")
        break